Kanzi 3.9.10
KanziRuntime Class Reference

Kanzi runtime infrastructure for an Android application. More...

Classes

class  Reference
 Manages the lifetime of the com.rightware.kanzi.KanziRuntime in one process. More...
 

Public Member Functions

void executeNativeGarbageCollection ()
 Executes the native garbage collection manually.
 
Domain getDomain ()
 Returns the Kanzi UI domain that was created for this runtime.
 
long getNative ()
 Gets a pointer to the backing C++ instance.
 
void loadKzb (String fileName) throws FileNotFoundException
 Loads a kzb file from the file system, if the file is not already loaded.
 
void scheduleNativeGarbageCollection (long delayInMs)
 Schedules automatic garbage collection of native objects to occur on given interval.
 
void setResourceDirectory (String path)
 Sets the source directory for kzb file reading and relative file reading performed through file resource protocol.
 
void stopNativeGarbageCollection ()
 Cancels automatic garbage collection of native objects started by scheduleNativeGarbageCollection(long delayInMs).
 

Static Public Member Functions

static Reference acquire (Context context)
 Acquire a Reference to the com.rightware.kanzi.KanziRuntime.
 

Detailed Description

Kanzi runtime infrastructure for an Android application.

Member Function Documentation

◆ acquire()

static Reference acquire ( Context context)
static

Acquire a Reference to the com.rightware.kanzi.KanziRuntime.

If KanziRuntime is not already initialized, you initialize it when you call this function.

Parameters
contextThe Android context used by the Kanzi Runtime. Can be an Activity or an Application Context.
Returns
The Reference that owns Kanzi Runtime.

◆ executeNativeGarbageCollection()

void executeNativeGarbageCollection ( )

Executes the native garbage collection manually.

This operation can be set to be performed periodically by calling scheduleNativeGarbageCollection(long delayInMs).

◆ getDomain()

Domain getDomain ( )

Returns the Kanzi UI domain that was created for this runtime.

Returns
Domain for this runtime.

◆ getNative()

long getNative ( )

Gets a pointer to the backing C++ instance.

Returns
A pointer to the backing C++ instance. Type: kanzi::Application*.

◆ loadKzb()

void loadKzb ( String fileName) throws FileNotFoundException

Loads a kzb file from the file system, if the file is not already loaded.

You can also pass a cfg file that contains a list of kzb files that you want to load.

To load additional kzb files with the same name, use com.rightware.kanzi.ResourceManager#addKzbFile(String).

Parameters
fileNameThe name of the kzb file to load.
Exceptions
InvalidKzbFileExceptionThrows an InvalidKzbFileException when the kzb file is invalid.
FileNotFoundExceptionThrows a FileNotFoundException when the kzb file is not found.

◆ scheduleNativeGarbageCollection()

void scheduleNativeGarbageCollection ( long delayInMs)

Schedules automatic garbage collection of native objects to occur on given interval.

In case the automatic garbage collection is not desired, it must be called manually.

Parameters
delayInMsInterval for garbage collection, in milliseconds.

◆ setResourceDirectory()

void setResourceDirectory ( String path)

Sets the source directory for kzb file reading and relative file reading performed through file resource protocol.

When set to empty string, APK assets directory is used as the source directory. This is the default value.

Parameters
pathThe path to use.